
CC=gcc
CFLAGS=-g -O2 -Wall -Wformat
LIBS=-lm -lasound -lsndfile

OBJ=opts.o pipes.o hw.o global.o
OBJ+= func-gen.o func-cap.o func-del.o func-txt.o func-math.o
OBJ+= func-blk.o func-trg.o func-fft.o func-pas.o

.SUFFIXES: .c .o

all: sndpipe

.c.o:
	@echo " CC $^"
	@$(CC) $(CFLAGS) -c $^ -o $@

sndpipe: $(OBJ) sndpipe.o
	@echo " LD $@"
	@$(CC) $(CFLAGS) $(LIBS) $^ -o $@

clean:
	@echo " CLEAN"
	@rm -f *.o sndpipe

again: clean all

fixme:
	@grep -RHni fixme *.[ch]

linecount:
	@wc -l *.[ch]

dist: clean
	@echo " DIST"
	@isodate=$$(date +%Y%m%d) && \
	 pushd .. >/dev/null && \
	 rm -rf sndpipe-$${isodate}.tar.gz && \
	 tar cf sndpipe-$${isodate}.tar sndpipe/ && \
	 gzip -9 sndpipe-$${isodate}.tar && \
	 popd >/dev/null

